From: Ian Jackson Date: Tue, 28 Jun 2011 11:19:17 +0000 (+0100) Subject: xl: xl block-attach -N (dry run) option X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~10102 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=6ec8890dfc2d323ffeac03a3aad486f4c5480264;p=xen.git xl: xl block-attach -N (dry run) option Signed-off-by: Ian Jackson Committed-by: Ian Jackson --- diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index d5c10eda39..5a11c633b5 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -4060,6 +4060,22 @@ int main_blockattach(int argc, char **argv) disk.backend_domid = be_domid; + if (dryrun_only) { + /* fixme: this should be generated from the idl */ + /* fixme: enums (backend, format) should be converted to strings */ + printf("disk.backend_domid = %"PRIx32"\n", disk.backend_domid); + printf("disk.pdev_path = %s\n", disk.pdev_path); + printf("disk.vdev = %s\n", disk.vdev); + printf("disk.backend = %d\n", disk.backend); + printf("disk.format = %d\n", disk.format); + printf("disk.script = %s\n", disk.script); + printf("disk.removable = %d\n", disk.removable); + printf("disk.readwrite = %d\n", disk.readwrite); + printf("disk.is_cdrom = %d\n", disk.is_cdrom); + if (ferror(stdout) || fflush(stdout)) { perror("stdout"); exit(-1); } + return 0; + } + if (libxl_device_disk_add(ctx, fe_domid, &disk)) { fprintf(stderr, "libxl_device_disk_add failed.\n"); } diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c index 924920b883..e6ff877415 100644 --- a/tools/libxl/xl_cmdtable.c +++ b/tools/libxl/xl_cmdtable.c @@ -256,7 +256,7 @@ struct cmd_spec cmd_table[] = { " ", }, { "block-attach", - &main_blockattach, 0, + &main_blockattach, 1, "Create a new virtual block device", " ...", },